3.54 \(\int \frac {\cot ^3(c+d x)}{a+i a \tan (c+d x)} \, dx\)

Optimal. Leaf size=90 \[ -\frac {\cot ^2(c+d x)}{a d}+\frac {3 i \cot (c+d x)}{2 a d}-\frac {2 \log (\sin (c+d x))}{a d}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac {3 i x}{2 a} \]

[Out]

3/2*I*x/a+3/2*I*cot(d*x+c)/a/d-cot(d*x+c)^2/a/d-2*ln(sin(d*x+c))/a/d+1/2*cot(d*x+c)^2/d/(a+I*a*tan(d*x+c))

________________________________________________________________________________________

Rubi [A]  time = 0.12, antiderivative size = 90, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3552, 3529, 3531, 3475} \[ -\frac {\cot ^2(c+d x)}{a d}+\frac {3 i \cot (c+d x)}{2 a d}-\frac {2 \log (\sin (c+d x))}{a d}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac {3 i x}{2 a} \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]^3/(a + I*a*Tan[c + d*x]),x]

[Out]

(((3*I)/2)*x)/a + (((3*I)/2)*Cot[c + d*x])/(a*d) - Cot[c + d*x]^2/(a*d) - (2*Log[Sin[c + d*x]])/(a*d) + Cot[c
+ d*x]^2/(2*d*(a + I*a*Tan[c + d*x]))

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3529

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((
b*c - a*d)*(a + b*Tan[e + f*x])^(m + 1))/(f*(m + 1)*(a^2 + b^2)), x] + Dist[1/(a^2 + b^2), Int[(a + b*Tan[e +
f*x])^(m + 1)*Simp[a*c + b*d - (b*c - a*d)*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c
 - a*d, 0] && NeQ[a^2 + b^2, 0] && LtQ[m, -1]

Rule 3531

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((a*c +
 b*d)*x)/(a^2 + b^2), x] + Dist[(b*c - a*d)/(a^2 + b^2), Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[a*c + b*d, 0]

Rule 3552

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[(a
*(c + d*Tan[e + f*x])^(n + 1))/(2*f*(b*c - a*d)*(a + b*Tan[e + f*x])), x] + Dist[1/(2*a*(b*c - a*d)), Int[(c +
 d*Tan[e + f*x])^n*Simp[b*c + a*d*(n - 1) - b*d*n*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x]
&& NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] &&  !GtQ[n, 0]

Rubi steps

\begin {align*} \int \frac {\cot ^3(c+d x)}{a+i a \tan (c+d x)} \, dx &=\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac {\int \cot ^3(c+d x) (-4 a+3 i a \tan (c+d x)) \, dx}{2 a^2}\\ &=-\frac {\cot ^2(c+d x)}{a d}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac {\int \cot ^2(c+d x) (3 i a+4 a \tan (c+d x)) \, dx}{2 a^2}\\ &=\frac {3 i \cot (c+d x)}{2 a d}-\frac {\cot ^2(c+d x)}{a d}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac {\int \cot (c+d x) (4 a-3 i a \tan (c+d x)) \, dx}{2 a^2}\\ &=\frac {3 i x}{2 a}+\frac {3 i \cot (c+d x)}{2 a d}-\frac {\cot ^2(c+d x)}{a d}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac {2 \int \cot (c+d x) \, dx}{a}\\ &=\frac {3 i x}{2 a}+\frac {3 i \cot (c+d x)}{2 a d}-\frac {\cot ^2(c+d x)}{a d}-\frac {2 \log (\sin (c+d x))}{a d}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 0.88, size = 414, normalized size = 4.60 \[ \frac {\csc \left (\frac {c}{2}\right ) \sec \left (\frac {c}{2}\right ) \csc ^2(c+d x) \sec (c+d x) \left (-2 d x \sin (2 c+d x)+i \sin (2 c+d x)-2 d x \sin (2 c+3 d x)+9 i \sin (2 c+3 d x)+2 d x \sin (4 c+3 d x)-i \sin (4 c+3 d x)+6 i d x \cos (2 c+d x)-3 \cos (2 c+d x)+2 i d x \cos (2 c+3 d x)+7 \cos (2 c+3 d x)-2 i d x \cos (4 c+3 d x)+\cos (4 c+3 d x)-4 i \sin (d x) \log \left (\sin ^2(c+d x)\right )+4 i \sin (2 c+d x) \log \left (\sin ^2(c+d x)\right )+4 i \sin (2 c+3 d x) \log \left (\sin ^2(c+d x)\right )-4 i \sin (4 c+3 d x) \log \left (\sin ^2(c+d x)\right )+\cos (d x) \left (-12 \log \left (\sin ^2(c+d x)\right )-6 i d x-5\right )+12 \cos (2 c+d x) \log \left (\sin ^2(c+d x)\right )+4 \cos (2 c+3 d x) \log \left (\sin ^2(c+d x)\right )-4 \cos (4 c+3 d x) \log \left (\sin ^2(c+d x)\right )+64 \sin (c) \tan ^{-1}(\tan (d x)) \sin ^2(c+d x) (\cos (c+d x)+i \sin (c+d x))+2 d x \sin (d x)-25 i \sin (d x)\right )}{64 a d (\tan (c+d x)-i)} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]^3/(a + I*a*Tan[c + d*x]),x]

[Out]

(Csc[c/2]*Csc[c + d*x]^2*Sec[c/2]*Sec[c + d*x]*(-3*Cos[2*c + d*x] + (6*I)*d*x*Cos[2*c + d*x] + 7*Cos[2*c + 3*d
*x] + (2*I)*d*x*Cos[2*c + 3*d*x] + Cos[4*c + 3*d*x] - (2*I)*d*x*Cos[4*c + 3*d*x] + Cos[d*x]*(-5 - (6*I)*d*x -
12*Log[Sin[c + d*x]^2]) + 12*Cos[2*c + d*x]*Log[Sin[c + d*x]^2] + 4*Cos[2*c + 3*d*x]*Log[Sin[c + d*x]^2] - 4*C
os[4*c + 3*d*x]*Log[Sin[c + d*x]^2] - (25*I)*Sin[d*x] + 2*d*x*Sin[d*x] - (4*I)*Log[Sin[c + d*x]^2]*Sin[d*x] +
64*ArcTan[Tan[d*x]]*Sin[c]*(Cos[c + d*x] + I*Sin[c + d*x])*Sin[c + d*x]^2 + I*Sin[2*c + d*x] - 2*d*x*Sin[2*c +
 d*x] + (4*I)*Log[Sin[c + d*x]^2]*Sin[2*c + d*x] + (9*I)*Sin[2*c + 3*d*x] - 2*d*x*Sin[2*c + 3*d*x] + (4*I)*Log
[Sin[c + d*x]^2]*Sin[2*c + 3*d*x] - I*Sin[4*c + 3*d*x] + 2*d*x*Sin[4*c + 3*d*x] - (4*I)*Log[Sin[c + d*x]^2]*Si
n[4*c + 3*d*x]))/(64*a*d*(-I + Tan[c + d*x]))

________________________________________________________________________________________

fricas [A]  time = 0.44, size = 134, normalized size = 1.49 \[ \frac {14 i \, d x e^{\left (6 i \, d x + 6 i \, c\right )} + {\left (-28 i \, d x - 1\right )} e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, {\left (-7 i \, d x - 5\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - 8 \, {\left (e^{\left (6 i \, d x + 6 i \, c\right )} - 2 \, e^{\left (4 i \, d x + 4 i \, c\right )} + e^{\left (2 i \, d x + 2 i \, c\right )}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right ) - 1}{4 \, {\left (a d e^{\left (6 i \, d x + 6 i \, c\right )} - 2 \, a d e^{\left (4 i \, d x + 4 i \, c\right )} + a d e^{\left (2 i \, d x + 2 i \, c\right )}\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^3/(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/4*(14*I*d*x*e^(6*I*d*x + 6*I*c) + (-28*I*d*x - 1)*e^(4*I*d*x + 4*I*c) - 2*(-7*I*d*x - 5)*e^(2*I*d*x + 2*I*c)
 - 8*(e^(6*I*d*x + 6*I*c) - 2*e^(4*I*d*x + 4*I*c) + e^(2*I*d*x + 2*I*c))*log(e^(2*I*d*x + 2*I*c) - 1) - 1)/(a*
d*e^(6*I*d*x + 6*I*c) - 2*a*d*e^(4*I*d*x + 4*I*c) + a*d*e^(2*I*d*x + 2*I*c))

________________________________________________________________________________________

giac [A]  time = 1.48, size = 105, normalized size = 1.17 \[ \frac {\frac {\log \left (\tan \left (d x + c\right ) + i\right )}{a} + \frac {7 \, \log \left (i \, \tan \left (d x + c\right ) + 1\right )}{a} - \frac {8 \, \log \left (\tan \left (d x + c\right )\right )}{a} - \frac {7 \, \tan \left (d x + c\right ) - 9 i}{a {\left (\tan \left (d x + c\right ) - i\right )}} + \frac {2 \, {\left (6 \, \tan \left (d x + c\right )^{2} + 2 i \, \tan \left (d x + c\right ) - 1\right )}}{a \tan \left (d x + c\right )^{2}}}{4 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^3/(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

1/4*(log(tan(d*x + c) + I)/a + 7*log(I*tan(d*x + c) + 1)/a - 8*log(tan(d*x + c))/a - (7*tan(d*x + c) - 9*I)/(a
*(tan(d*x + c) - I)) + 2*(6*tan(d*x + c)^2 + 2*I*tan(d*x + c) - 1)/(a*tan(d*x + c)^2))/d

________________________________________________________________________________________

maple [A]  time = 0.46, size = 106, normalized size = 1.18 \[ \frac {\ln \left (\tan \left (d x +c \right )+i\right )}{4 d a}-\frac {1}{2 a d \tan \left (d x +c \right )^{2}}+\frac {i}{a d \tan \left (d x +c \right )}-\frac {2 \ln \left (\tan \left (d x +c \right )\right )}{d a}+\frac {i}{2 d a \left (\tan \left (d x +c \right )-i\right )}+\frac {7 \ln \left (\tan \left (d x +c \right )-i\right )}{4 d a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)^3/(a+I*a*tan(d*x+c)),x)

[Out]

1/4/d/a*ln(tan(d*x+c)+I)-1/2/a/d/tan(d*x+c)^2+I/a/d/tan(d*x+c)-2/d/a*ln(tan(d*x+c))+1/2*I/d/a/(tan(d*x+c)-I)+7
/4/d/a*ln(tan(d*x+c)-I)

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^3/(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

mupad [B]  time = 3.97, size = 110, normalized size = 1.22 \[ \frac {7\,\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )}{4\,a\,d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )}{4\,a\,d}-\frac {2\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{a\,d}-\frac {\frac {1}{2\,a}+\frac {3\,{\mathrm {tan}\left (c+d\,x\right )}^2}{2\,a}-\frac {\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}{2\,a}}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^3\,1{}\mathrm {i}+{\mathrm {tan}\left (c+d\,x\right )}^2\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(c + d*x)^3/(a + a*tan(c + d*x)*1i),x)

[Out]

(7*log(tan(c + d*x) - 1i))/(4*a*d) + log(tan(c + d*x) + 1i)/(4*a*d) - (2*log(tan(c + d*x)))/(a*d) - (1/(2*a) -
 (tan(c + d*x)*1i)/(2*a) + (3*tan(c + d*x)^2)/(2*a))/(d*(tan(c + d*x)^2 + tan(c + d*x)^3*1i))

________________________________________________________________________________________

sympy [A]  time = 0.48, size = 139, normalized size = 1.54 \[ \begin {cases} - \frac {e^{- 2 i c} e^{- 2 i d x}}{4 a d} & \text {for}\: 4 a d e^{2 i c} \neq 0 \\x \left (\frac {i \left (7 e^{2 i c} + 1\right ) e^{- 2 i c}}{2 a} - \frac {7 i}{2 a}\right ) & \text {otherwise} \end {cases} - \frac {2}{- a d e^{4 i c} e^{4 i d x} + 2 a d e^{2 i c} e^{2 i d x} - a d} + \frac {7 i x}{2 a} - \frac {2 \log {\left (e^{2 i d x} - e^{- 2 i c} \right )}}{a d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)**3/(a+I*a*tan(d*x+c)),x)

[Out]

Piecewise((-exp(-2*I*c)*exp(-2*I*d*x)/(4*a*d), Ne(4*a*d*exp(2*I*c), 0)), (x*(I*(7*exp(2*I*c) + 1)*exp(-2*I*c)/
(2*a) - 7*I/(2*a)), True)) - 2/(-a*d*exp(4*I*c)*exp(4*I*d*x) + 2*a*d*exp(2*I*c)*exp(2*I*d*x) - a*d) + 7*I*x/(2
*a) - 2*log(exp(2*I*d*x) - exp(-2*I*c))/(a*d)

________________________________________________________________________________________